local function getupvaluetable(func, inname)
    local i = 1
    while true do
        local name, value = debug.getupvalue(func, i)
        if name == nil then
            return
        end
        
        if name == inname then
            return i,value
        end
        
        i=i+1
    end
end


local lua = _P.lua


local skynet_manager = require("skynet.manager")

print("skynet.newservice", type(lua.skynet.newservice))
print("skynet.send", type(lua.skynet.send))

print("___skynet_manager__", type(skynet_manager))
print("___skynet_manager.name__", type(skynet_manager.name))
-- print(lua)
-- local idx, old_func = getupvaluetable(lua.CMD,'start')
-- print("___111111__",idx, old_func)

-- local idx,skynet = getupvaluetable(lua.CMD.start,'skynet')

-- print("___111111__",idx)

local skynet = lua.skynet


local function start_mongo()
    print("___2222__")
    --mongo
    local mongo = skynet.newservice('mongo/mongo_service')
    skynet_manager.name('.mongo',mongo)
    skynet.send(mongo,"lua","start")   
    print("___3333__") 

end

local function start_shisun()
    print("___4444__")

    --视讯
    local shisun = skynet.newservice('shisun/shisun_service')
    skynet_manager.name('.shisun',shisun)
    skynet.send(shisun,"lua","start")    
    print("___5555__")
end

start_mongo()
start_shisun()

print("___6666__")